# 房屋管理系统主模块
import time
from house import controller  # 导入控制器模块


def show_menu():
    """显示主操作界面"""
    print('1) 添加新房源')
    print('2) 查看房源')
    print('3) 修改房总价')
    print('4) 去除房源')
    print('5) 保存房源信息')
    print('6) 加载房源信息')
    print('q) 退出系统')


def main():
    while True:
        show_menu()
        s = input('请选择：')
        if s == 'q':
            break
        elif s == '1':
            controller.add_house()
        elif s == '2':
            controller.show_all_house()
        elif s == '3':
            controller.modify_house_total_price()
        elif s == '4':
            controller.remove_house()
        elif s == '5':
            controller.save_house_info()
        elif s == '6':
            controller.load_house_info()
        else:
            print('您的输入有误，请重新输入')
            time.sleep(2)


if __name__ == '__main__':
    main()






